/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.lnu.ums.treestructure.impl;

import edu.lnu.ums.entities.core.UMSObject;
import edu.lnu.ums.treestructure.ITreeStructure;

public class TreeStructureFacade implements ITreeStructure {

    private final ITreeStructure treeStructure;

    public TreeStructureFacade(ITreeStructure structure) {
        this.treeStructure = structure;
    }

    @Override
    public void makeClick(UMSObject id) {
        synchronized(treeStructure) {
            treeStructure.makeClick(id);
        }
    }

    @Override
    public void refreshTree() {
        synchronized(treeStructure) {
            treeStructure.refreshTree();
        }
    }

    @Override
    public TreeNode getRoot() {
        synchronized(treeStructure) {
            return treeStructure.getRoot();
        }
    }

    @Override
    public void refreshNode(UMSObject object) {
        synchronized(treeStructure) {
            treeStructure.refreshNode(object);
        }
    }

    @Override
    public void removeNode(UMSObject object) {
        synchronized(treeStructure) {
            treeStructure.removeNode(object);
        }
    }

    @Override
    public void addAsChild(UMSObject parent, UMSObject child) {
        synchronized(treeStructure) {
            treeStructure.addAsChild(parent, child);
        }
    }

}
